﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Business;
using Telerik.Web.UI;
using System.Collections;

namespace BVVD_Website.ql_hoc_vien
{
    public partial class frmHocphi : System.Web.UI.Page
    {

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {

                grvHocphi.DataSource = getData();
                grvHocphi.DataBind();
            }
        }
        private List<F_DONGHOCPHI> getData()
        {
            BVVDDataStore<F_DONGHOCPHI> db = new BVVDDataStore<F_DONGHOCPHI>();
            return db.getFromDB(new Hashtable());

        }
        protected void grvHocphi_NeedDataSource(object sender, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
        {
            grvHocphi.DataSource = getData();
        }
        protected void RadSearchBox1_Search(object sender, Telerik.Web.UI.SearchBoxEventArgs e)
        {
            RadSearchBox chkbox = (RadSearchBox)sender;
            GridEditFormItem editItem = (GridEditFormItem)chkbox.NamingContainer;
            RadTextBox txtbox = (RadTextBox)editItem.FindControl("txtMAHV");
            if (e.DataItem != null)
            {
                txtbox.Text = ((Dictionary<string, object>)e.DataItem)["MAHV"].ToString();
            }
            //grvHocphi.MasterTableView.EditFormSettings.form.Text = ((Dictionary<string, object>)e.DataItem)["MADM"].ToString();
        }
    }
}